package top.chenfu.mq.consumer;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

/**
 * @Author: romantic_ke@163.com
 * @Description:
 * @Date: 2019/8/13 21:59
 */
@Component
@RabbitListener(
        bindings = @QueueBinding(
                value = @Queue(
                        value = "${mq.config.queue.info}",
                        autoDelete = "true"),
                exchange = @Exchange(
                        value = "${mq.config.exchange}",
                        type = ExchangeTypes.DIRECT),
                key = "${mq.config.queue.info.routing.key}"
        )
)
public class InfoConsumer {

    @RabbitHandler
    public void printInfoMsg(String msg) {
        System.out.println();
        System.out.println(this.getClass().getName() + "消息被消费了。。。。。。" + msg);
    }

}
